[N]Hibernate Sessions

Posted by Jaimal Chohan on Stack Overflow See other posts from Stack Overflow or by Jaimal Chohan
Published on 2010-03-29T21:22:23Z Indexed on 2010/03/29 21:23 UTC
Read the original article Hit count: 291

Filed under:

A silly question, perhaps, but at this time of night, StackOverFlow is my only friend.

I'm playing with NHibernate and wanted to factualize these 2 statements regarding Sessions in web applications.

1) You should only ever have 1 ISessionFactory per database for the lifecycle of an application.

2) You should only have 1 ISession per HttpRequest or batch of HttpRequests (i.e. conversation)

[I don't want tool or framework recommendation, just want to confirm the above]

© Stack Overflow or respective owner

Related posts about nhibernate